//
//  MyAccountCustomButton.m
//  WashForU
//
//  Created by 王俊 on 15/12/10.
//  Copyright © 2015年 王俊. All rights reserved.
//

#import "MyAccountCustomButton.h"

@interface MyAccountCustomButton()
@property(nonatomic,strong)UILabel       *nameLabel;
@property(nonatomic,strong)UIImageView   *arrowImage;

@end

@implementation MyAccountCustomButton

- (instancetype)initWithTitle:(NSString *) title
{
    if (self = [super init]) {
        self.backgroundColor = [UIColor whiteColor];
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.text = title;
        self.nameLabel.font = [UIFont CustomFont:17];
        self.arrowImage = [[UIImageView alloc]init];
        self.arrowImage.image = [UIImage imageNamed:@"右箭头"];
        
        [self addSubview:self.nameLabel];
        [self addSubview:self.arrowImage];
        [self addCustomConstrains];

    }
    return self;
}

- (void)addCustomConstrains
{
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.leading.equalTo(self).offset(20);
        make.height.mas_equalTo(30);
    }];
    [self.arrowImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(8, 13));
        make.centerY.equalTo(self);
        make.trailing.equalTo(self).offset(-20);
    }];
}

@end
